package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.Attachements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AttachementMapper;

import com.ruoyi.system.service.IAttachementsService;
import com.ruoyi.common.support.Convert;

/**
 * 附件 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-16
 */
@Service
public class AttachementsServiceImpl implements IAttachementsService
{
	@Autowired
	private AttachementMapper attachementMapper;

	/**
     * 查询附件信息
     * 
     * @param attachmentsId 附件ID
     * @return 附件信息
     */
    @Override
	public Attachements selectAttachementsById(Integer attachmentsId)
	{
	    return attachementMapper.selectAttachementById(attachmentsId);
	}
	
	/**
     * 查询附件列表
     * 
     * @param attachements 附件信息
     * @return 附件集合
     */
	@Override
	public List<Attachements> selectAttachementsList(Attachements attachements)
	{
	    return attachementMapper.selectAttachementList(attachements);
	}
	
    /**
     * 新增附件
     * 
     * @param attachements 附件信息
     * @return 结果
     */
	@Override
	public int insertAttachements(Attachements attachements)
	{
	    return attachementMapper.insertAttachement(attachements);
	}
	
	/**
     * 修改附件
     * 
     * @param attachement 附件信息
     * @return 结果
     */
	@Override
	public int updateAttachements(Attachements attachement)
	{
	    return attachementMapper.updateAttachement(attachement);
	}

	/**
     * 删除附件对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAttachementsByIds(String ids)
	{
		return attachementMapper.deleteAttachementByIds(Convert.toStrArray(ids));
	}

	/**
	 * 根据广告Id查询图片信息
	 * @param advertinfoId
	 * @return
	 */
	@Override
	public Attachements findByOfId(Integer advertinfoId) {
		return attachementMapper.findByOfId(advertinfoId);
	}

}
